<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SWM34S_LVGL7.11_SWMUI: C:/Users/DELL/Desktop/Commit/lvgl/SWM34S_LVGL7.11_SWMUI_20230515/APP/Common Module/posix_fsm.c 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SWM34S_LVGL7.11_SWMUI<span id="projectnumber">&#160;V7.9</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.5 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_0ca16891106f5a3e9ad635a0d6c5f98f.html">APP</a></li><li class="navelem"><a class="el" href="dir_df4e0e4e72f77ab290fd1a24f190250a.html">Common Module</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">posix_fsm.c</div></div>
</div><!--header-->
<div class="contents">
<a href="posix__fsm_8c.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="preprocessor">#include &quot;<a class="code" href="posix__fsm_8h.html">posix_fsm.h</a>&quot;</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="posix__fsm_8c.html#a02397a7a821d3ddd678b34eea5e94054">   38</a></span><a class="code hl_enumeration" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091">fsm_result</a> <a class="code hl_function" href="posix__fsm_8c.html#a02397a7a821d3ddd678b34eea5e94054">fsm_state_get</a>(<a class="code hl_struct" href="structfsm__t.html">fsm_t</a> *fsm, <span class="keywordtype">int</span> *state)</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>{</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>    <span class="keywordflow">if</span> (<a class="code hl_function" href="pthread__lock_8h.html#a5b24d442627e9343245d4a44daa81ada">pthread_mutex_lock</a>(&amp;fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a4acff8232e4aec9cd5c6dc200ac55ef3">mutex</a>) != 0)</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>        <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091accae8a0539fcc80bbcd302dcb80c1dc2">FSM_VIE_LOCK</a>;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>    *state = fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a89f234133d3efe315836311cbf21c64b">state</a>;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>    <a class="code hl_function" href="pthread__lock_8h.html#a4f08153d45685a64dd5901e150b988ef">pthread_mutex_unlock</a>(&amp;fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a4acff8232e4aec9cd5c6dc200ac55ef3">mutex</a>);</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a>;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>}</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span> </div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="posix__fsm_8c.html#a2c6b5bc8fb41f77bb9f814eba2865387">   54</a></span><a class="code hl_enumeration" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091">fsm_result</a> <a class="code hl_function" href="posix__fsm_8c.html#a2c6b5bc8fb41f77bb9f814eba2865387">fsm_state_set</a>(<a class="code hl_struct" href="structfsm__t.html">fsm_t</a> *fsm, <span class="keywordtype">int</span> state)</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>{</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>    <span class="keywordflow">if</span> (<a class="code hl_function" href="pthread__lock_8h.html#a5b24d442627e9343245d4a44daa81ada">pthread_mutex_lock</a>(&amp;fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a4acff8232e4aec9cd5c6dc200ac55ef3">mutex</a>) != 0)</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>        <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091accae8a0539fcc80bbcd302dcb80c1dc2">FSM_VIE_LOCK</a>;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>    fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a89f234133d3efe315836311cbf21c64b">state</a> = state;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>    <a class="code hl_function" href="pthread__lock_8h.html#a4f08153d45685a64dd5901e150b988ef">pthread_mutex_unlock</a>(&amp;fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a4acff8232e4aec9cd5c6dc200ac55ef3">mutex</a>);</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a>;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>}</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="posix__fsm_8c.html#a249b00e99d18d8fd190204d78b2eab9f">   71</a></span><a class="code hl_enumeration" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091">fsm_result</a> <a class="code hl_function" href="posix__fsm_8c.html#a249b00e99d18d8fd190204d78b2eab9f">fsm_event_handler_get</a>(<a class="code hl_struct" href="structfsm__t.html">fsm_t</a> *fsm, <span class="keywordtype">int</span> event, <a class="code hl_typedef" href="posix__fsm_8h.html#afbb49b7791a06820386f19c692dd5cc0">fsm_event_cb</a> *action)</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>{</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>    *action = NULL;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>    <span class="keywordflow">if</span> (<a class="code hl_function" href="pthread__lock_8h.html#a5b24d442627e9343245d4a44daa81ada">pthread_mutex_lock</a>(&amp;fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a4acff8232e4aec9cd5c6dc200ac55ef3">mutex</a>) != 0)</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>        <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091accae8a0539fcc80bbcd302dcb80c1dc2">FSM_VIE_LOCK</a>;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span> </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>    <span class="keywordflow">for</span> (i = 0; i &lt; fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a28e66c69fc071a9a0a447a9e77f9219f">table_num</a>; ++i)</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>    {</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>        <span class="keywordflow">if</span> (fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a89f234133d3efe315836311cbf21c64b">state</a> == fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a1de5159247bef46fcdced877da3efdea">table</a>[i].<a class="code hl_variable" href="structfsm__handle__t.html#a8dae6ee4b13f5a7860eceb6099fa4ab1">cur_state</a> &amp;&amp; event == fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a1de5159247bef46fcdced877da3efdea">table</a>[i].<a class="code hl_variable" href="structfsm__handle__t.html#ab054ab6d3f8f71fd96ebe13af952e40e">trigger_event</a>)</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>        {</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>            *action = fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a1de5159247bef46fcdced877da3efdea">table</a>[i].<a class="code hl_variable" href="structfsm__handle__t.html#abdb6971287fea3369cc6691448e8a4cb">do_action</a>;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>            <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>        }</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>    }</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>    <a class="code hl_function" href="pthread__lock_8h.html#a4f08153d45685a64dd5901e150b988ef">pthread_mutex_unlock</a>(&amp;fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a4acff8232e4aec9cd5c6dc200ac55ef3">mutex</a>);</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>    <span class="keywordflow">return</span> (i &lt; fsm-&gt;table_num) ? <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a> : <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091ad2a5a798ec70b449e8d1b2e3068f7af9">FSM_GO_TRAP</a>;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>}</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span> </div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="posix__fsm_8c.html#a0b1b28d5d26c97b4c934f7822c1a7a04">   98</a></span><a class="code hl_enumeration" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091">fsm_result</a> <a class="code hl_function" href="posix__fsm_8c.html#a0b1b28d5d26c97b4c934f7822c1a7a04">fsm_event_exec</a>(<a class="code hl_struct" href="structfsm__t.html">fsm_t</a> *fsm, <span class="keywordtype">int</span> event, <span class="keywordtype">void</span> *data)</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>{</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span> </div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>    <span class="keywordflow">if</span> (<a class="code hl_function" href="pthread__lock_8h.html#a5b24d442627e9343245d4a44daa81ada">pthread_mutex_lock</a>(&amp;fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a4acff8232e4aec9cd5c6dc200ac55ef3">mutex</a>) != 0)</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span>        <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091accae8a0539fcc80bbcd302dcb80c1dc2">FSM_VIE_LOCK</a>;</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span> </div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>    <span class="keywordflow">for</span> (i = 0; i &lt; fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a28e66c69fc071a9a0a447a9e77f9219f">table_num</a>; ++i)</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span>    {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span>        <span class="keywordflow">if</span> (fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a89f234133d3efe315836311cbf21c64b">state</a> == fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a1de5159247bef46fcdced877da3efdea">table</a>[i].<a class="code hl_variable" href="structfsm__handle__t.html#a8dae6ee4b13f5a7860eceb6099fa4ab1">cur_state</a> &amp;&amp; event == fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a1de5159247bef46fcdced877da3efdea">table</a>[i].<a class="code hl_variable" href="structfsm__handle__t.html#ab054ab6d3f8f71fd96ebe13af952e40e">trigger_event</a>)</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>        {</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span>            <span class="keywordtype">int</span> transfer_state = fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a1de5159247bef46fcdced877da3efdea">table</a>[i].<a class="code hl_variable" href="structfsm__handle__t.html#ac0c302bc97f010b7f5965faa07b00354">next_state</a>;</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span>            <span class="keywordflow">if</span> (fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a1de5159247bef46fcdced877da3efdea">table</a>[i].<a class="code hl_variable" href="structfsm__handle__t.html#abdb6971287fea3369cc6691448e8a4cb">do_action</a> != NULL)</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span>            {</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>                transfer_state = fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a1de5159247bef46fcdced877da3efdea">table</a>[i].<a class="code hl_variable" href="structfsm__handle__t.html#abdb6971287fea3369cc6691448e8a4cb">do_action</a>(data); <span class="comment">/* 动作执行 */</span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>            }</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span>            <span class="comment">//printf(&quot;change state [%d] -&gt; [%d]\n&quot;, fsm-&gt;state, fsm-&gt;table[i].next_state);</span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span>            fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a89f234133d3efe315836311cbf21c64b">state</a> = transfer_state;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>            <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>        }</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>    }</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span>    <a class="code hl_function" href="pthread__lock_8h.html#a4f08153d45685a64dd5901e150b988ef">pthread_mutex_unlock</a>(&amp;fsm-&gt;<a class="code hl_variable" href="structfsm__t.html#a4acff8232e4aec9cd5c6dc200ac55ef3">mutex</a>);</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span>    <span class="keywordflow">return</span> (i &lt; fsm-&gt;table_num) ? <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a> : <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091ad2a5a798ec70b449e8d1b2e3068f7af9">FSM_GO_TRAP</a>;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span>}</div>
<div class="ttc" id="aposix__fsm_8c_html_a02397a7a821d3ddd678b34eea5e94054"><div class="ttname"><a href="posix__fsm_8c.html#a02397a7a821d3ddd678b34eea5e94054">fsm_state_get</a></div><div class="ttdeci">fsm_result fsm_state_get(fsm_t *fsm, int *state)</div><div class="ttdoc">获取当前状态</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8c_source.html#l00038">posix_fsm.c:38</a></div></div>
<div class="ttc" id="aposix__fsm_8c_html_a0b1b28d5d26c97b4c934f7822c1a7a04"><div class="ttname"><a href="posix__fsm_8c.html#a0b1b28d5d26c97b4c934f7822c1a7a04">fsm_event_exec</a></div><div class="ttdeci">fsm_result fsm_event_exec(fsm_t *fsm, int event, void *data)</div><div class="ttdoc">当指定事件触发时, 状态机会自动寻找并调用对应的动作处理回调, 从而完成状态转移</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8c_source.html#l00098">posix_fsm.c:98</a></div></div>
<div class="ttc" id="aposix__fsm_8c_html_a249b00e99d18d8fd190204d78b2eab9f"><div class="ttname"><a href="posix__fsm_8c.html#a249b00e99d18d8fd190204d78b2eab9f">fsm_event_handler_get</a></div><div class="ttdeci">fsm_result fsm_event_handler_get(fsm_t *fsm, int event, fsm_event_cb *action)</div><div class="ttdoc">通过该方法获取在当前状态下, 指定事件到来时的对应动作处理回调</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8c_source.html#l00071">posix_fsm.c:71</a></div></div>
<div class="ttc" id="aposix__fsm_8c_html_a2c6b5bc8fb41f77bb9f814eba2865387"><div class="ttname"><a href="posix__fsm_8c.html#a2c6b5bc8fb41f77bb9f814eba2865387">fsm_state_set</a></div><div class="ttdeci">fsm_result fsm_state_set(fsm_t *fsm, int state)</div><div class="ttdoc">切换当前状态</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8c_source.html#l00054">posix_fsm.c:54</a></div></div>
<div class="ttc" id="aposix__fsm_8h_html"><div class="ttname"><a href="posix__fsm_8h.html">posix_fsm.h</a></div><div class="ttdoc">有限状态机实现</div></div>
<div class="ttc" id="aposix__fsm_8h_html_a21f736acd6f712522de85c096c7ec091"><div class="ttname"><a href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091">fsm_result</a></div><div class="ttdeci">fsm_result</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00042">posix_fsm.h:42</a></div></div>
<div class="ttc" id="aposix__fsm_8h_html_a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630"><div class="ttname"><a href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a></div><div class="ttdeci">@ FSM_RT_OK</div><div class="ttdoc">成功</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00043">posix_fsm.h:43</a></div></div>
<div class="ttc" id="aposix__fsm_8h_html_a21f736acd6f712522de85c096c7ec091accae8a0539fcc80bbcd302dcb80c1dc2"><div class="ttname"><a href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091accae8a0539fcc80bbcd302dcb80c1dc2">FSM_VIE_LOCK</a></div><div class="ttdeci">@ FSM_VIE_LOCK</div><div class="ttdoc">竞争锁</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00044">posix_fsm.h:44</a></div></div>
<div class="ttc" id="aposix__fsm_8h_html_a21f736acd6f712522de85c096c7ec091ad2a5a798ec70b449e8d1b2e3068f7af9"><div class="ttname"><a href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091ad2a5a798ec70b449e8d1b2e3068f7af9">FSM_GO_TRAP</a></div><div class="ttdeci">@ FSM_GO_TRAP</div><div class="ttdoc">陷入陷阱</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00045">posix_fsm.h:45</a></div></div>
<div class="ttc" id="aposix__fsm_8h_html_afbb49b7791a06820386f19c692dd5cc0"><div class="ttname"><a href="posix__fsm_8h.html#afbb49b7791a06820386f19c692dd5cc0">fsm_event_cb</a></div><div class="ttdeci">int(* fsm_event_cb)(void *)</div><div class="ttdoc">触发事件执行动作回调</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00054">posix_fsm.h:54</a></div></div>
<div class="ttc" id="apthread__lock_8h_html_a4f08153d45685a64dd5901e150b988ef"><div class="ttname"><a href="pthread__lock_8h.html#a4f08153d45685a64dd5901e150b988ef">pthread_mutex_unlock</a></div><div class="ttdeci">static void pthread_mutex_unlock(pthread_mutex_t *ptr)</div><div class="ttdoc">解锁</div><div class="ttdef"><b>Definition:</b> <a href="pthread__lock_8h_source.html#l00055">pthread_lock.h:55</a></div></div>
<div class="ttc" id="apthread__lock_8h_html_a5b24d442627e9343245d4a44daa81ada"><div class="ttname"><a href="pthread__lock_8h.html#a5b24d442627e9343245d4a44daa81ada">pthread_mutex_lock</a></div><div class="ttdeci">static uint8_t pthread_mutex_lock(pthread_mutex_t *ptr)</div><div class="ttdoc">加锁</div><div class="ttdef"><b>Definition:</b> <a href="pthread__lock_8h_source.html#l00042">pthread_lock.h:42</a></div></div>
<div class="ttc" id="astructfsm__handle__t_html_a8dae6ee4b13f5a7860eceb6099fa4ab1"><div class="ttname"><a href="structfsm__handle__t.html#a8dae6ee4b13f5a7860eceb6099fa4ab1">fsm_handle_t::cur_state</a></div><div class="ttdeci">int cur_state</div><div class="ttdoc">当前状态</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00057">posix_fsm.h:57</a></div></div>
<div class="ttc" id="astructfsm__handle__t_html_ab054ab6d3f8f71fd96ebe13af952e40e"><div class="ttname"><a href="structfsm__handle__t.html#ab054ab6d3f8f71fd96ebe13af952e40e">fsm_handle_t::trigger_event</a></div><div class="ttdeci">int trigger_event</div><div class="ttdoc">触发事件</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00058">posix_fsm.h:58</a></div></div>
<div class="ttc" id="astructfsm__handle__t_html_abdb6971287fea3369cc6691448e8a4cb"><div class="ttname"><a href="structfsm__handle__t.html#abdb6971287fea3369cc6691448e8a4cb">fsm_handle_t::do_action</a></div><div class="ttdeci">fsm_event_cb do_action</div><div class="ttdoc">动作回调(如未定义-即NULL, 则表示当前事件无动作, 直接转移状态)</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00059">posix_fsm.h:59</a></div></div>
<div class="ttc" id="astructfsm__handle__t_html_ac0c302bc97f010b7f5965faa07b00354"><div class="ttname"><a href="structfsm__handle__t.html#ac0c302bc97f010b7f5965faa07b00354">fsm_handle_t::next_state</a></div><div class="ttdeci">int next_state</div><div class="ttdoc">转移状态</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00060">posix_fsm.h:60</a></div></div>
<div class="ttc" id="astructfsm__t_html"><div class="ttname"><a href="structfsm__t.html">fsm_t</a></div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00064">posix_fsm.h:64</a></div></div>
<div class="ttc" id="astructfsm__t_html_a1de5159247bef46fcdced877da3efdea"><div class="ttname"><a href="structfsm__t.html#a1de5159247bef46fcdced877da3efdea">fsm_t::table</a></div><div class="ttdeci">fsm_handle_t * table</div><div class="ttdoc">状态迁移表</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00066">posix_fsm.h:66</a></div></div>
<div class="ttc" id="astructfsm__t_html_a28e66c69fc071a9a0a447a9e77f9219f"><div class="ttname"><a href="structfsm__t.html#a28e66c69fc071a9a0a447a9e77f9219f">fsm_t::table_num</a></div><div class="ttdeci">unsigned int table_num</div><div class="ttdoc">状态迁移表大小</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00067">posix_fsm.h:67</a></div></div>
<div class="ttc" id="astructfsm__t_html_a4acff8232e4aec9cd5c6dc200ac55ef3"><div class="ttname"><a href="structfsm__t.html#a4acff8232e4aec9cd5c6dc200ac55ef3">fsm_t::mutex</a></div><div class="ttdeci">pthread_mutex_t mutex</div><div class="ttdoc">互斥锁保持访问状态变量的原子性</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00068">posix_fsm.h:68</a></div></div>
<div class="ttc" id="astructfsm__t_html_a89f234133d3efe315836311cbf21c64b"><div class="ttname"><a href="structfsm__t.html#a89f234133d3efe315836311cbf21c64b">fsm_t::state</a></div><div class="ttdeci">int state</div><div class="ttdoc">维护状态变量</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00065">posix_fsm.h:65</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
